﻿using Dither.Framework;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace Dither.VersionSelector.Models
{
    internal class CreateRuleTreeModel
    {
        public ObservableCollection<ExecutableItem> RecommendedPrograms { get; private set; }

        public CreateRuleTreeModel()
        {
            RecommendedPrograms = new ObservableCollection<ExecutableItem>();

            LoadRecommendedPrograms();
        }

        private void LoadRecommendedPrograms()
        {
            IEnumerable<string> recommendedPrograms = ExtendedEnvironment.Shell.GetRecommendedPrograms(".sln");

            foreach (var item in recommendedPrograms)
            {
                RecommendedPrograms.Add(new ExecutableItem(item));
            }
        }
    }
}
